package com.realife.eson.task.coordinate;

import com.realife.eson.common.util.common.SpringBeanUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @version V1.0
 * @author: guangcheng
 * @date: 2022/6/26 1:13
 * @description:
 */
//@EnableFeignClients(basePackages = {"com.paas.bocloud.upms.*.api"})
//@EnableFeignClients(basePackages = {"*"})
@Slf4j
@EnableAspectJAutoProxy(proxyTargetClass = true)
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@EnableScheduling
@EnableAsync
@ComponentScan(basePackages = {"com.realife.eson.common","com.realife.eson.task.coordinate"})
public class TaskCoordinateRunApp implements CommandLineRunner {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(TaskCoordinateRunApp.class, args);
        for (String beanDefinitionName : run.getBeanDefinitionNames()) {
            System.out.println("beanDefinitionName = " + beanDefinitionName);
        }
        System.out.println("run.getBeanDefinitionCount() = " + run.getBeanDefinitionCount());

        SpringBeanUtil.setApplicationContext(run);
    }


    @Override
    public void run(String... args) throws Exception {
        log.debug(">>>>>>>>>>>>>>> RunApplication 启动完成<<<<<<<<<<<<<");
    }


}
